import Vue from "vue";
import Router from "vue-router";

import login from "../views/login";
import index from "../views/index";

/**
 * 基础菜单
 */

//学生

//作业
import homework from "../views/student/homework";
//考试
import test from "../views/student/test";
//提问
import ask from "../views/student/ask";
//问答中心
import q_a_center from "../views/student/q_a_center";
//已做题库
import question_completed from "../views/student/question_completed";
//错题题库
import mistakes from "../views/student/mistakes";
//数据分析
import stu_data_analysis from "../views/student/stu_data_analysis";
// //个人中心
// import stu_personal from "../views/student/stu_personal";
//个人中心
import stu_data from "../views/student/stu_personal/stu_data";
//我收藏的题目
import collection_title from "../views/student/stu_personal/collection_title";
//我收藏的文章
import collection_article from "../views/student/stu_personal/collection_article";
//文章搜索
import article_search from "../views/student/article_search";
//我收藏的题目
import read_article from "../views/student/stu_personal/read_article";
//视频搜索
import video_search from "../views/student/video_search";
//文理科选择
import choose_subject from "../views/student/choose_subject";
//作业页面
import job from "../views/student/job";
//考试页面
import exam from "../views/student/exam";

/**
 * 老师
 */
//作业布置
import assign_homework from "../views/teacher/assign_homework";
// //试卷批阅
// import paper_reviews from "../views/teacher/paper_reviews";
//家庭作业批阅
import correcting_homework from "../views/teacher/paper_reviews/correcting_homework";
//试卷批阅
import correcting_paper from "../views/teacher/paper_reviews/correcting_paper";
//开始批阅作业
import correct from "../views/teacher/paper_reviews/correct";
//开始批阅试卷
import correctpaper from "../views/teacher/paper_reviews/correctpaper";
//问题解答
import problem_solving from "../views/teacher/problem_solving";
//试卷上传
import paper_upload from "../views/teacher/paper_upload";
//视频上传
import upload_vedio from "../views/teacher/upload_vedio";
//差生池
import pool from "../views/teacher/pool";
//数据分析
import xxx from "../views/teacher/tea_data_analysis/xxx";
//文章发布
import article_publishing from "../views/teacher/article_publishing";
//个人中心
import tea_personal from "../views/teacher/tea_personal";
//班级数据对比
import class_data_comparison from "../views/teacher/tea_data_analysis/class_data_comparison";
//学生排名分布
import student_rank from "../views/teacher/tea_data_analysis/student_rank";
//
import a from "../views/teacher/tea_data_analysis/a";

/**
 * 班主任
 */
//布置作业
import headtea_assign_homework from "../views/headteacher/headtea_assign_homework";
//试卷批阅
import headtea_paper_reviews from "../views/headteacher/headtea_paper_reviews";
//问题解答
import headtea_problem_solving from "../views/headteacher/headtea_problem_solving";
//试卷上传
import headtea_paper_upload from "../views/headteacher/headtea_paper_upload";
//视频上传
import headtea_upload_vedio from "../views/headteacher/headtea_upload_vedio";
//差生池
import headtea_pool from "../views/headteacher/headtea_pool";
//各科数据
import data_by_subject from "../views/headteacher/data_by_subject";
//学生账号查询
import student_account_query from "../views/headteacher/student_account_management/student_account_query";
//添加学生账号
import student_account_add from "../views/headteacher/student_account_management/student_account_add";
//转班处理
import change_of_class from "../views/headteacher/student_account_management/change_of_class";
//转班处理
import change_of_classmessage from "../views/headteacher/student_account_management/change_of_classmessage";
//高考数据录入
import college_entrance_examination_data_entry from "../views/headteacher/college_entrance_examination_data_entry";
//数据分析
import headtea_data_analysis from "../views/headteacher/headtea_data_analysis";
//个人中心
import headtea_personal from "../views/headteacher/headtea_personal";

/**
 * 年级主任
 */
//作业布置
import grade_assign_homework from "../views/gradedean/grade_assign_homework";
//试卷批阅
import grade_paper_reviews from "../views/gradedean/grade_paper_reviews";
//问题解答
import grade_problem_solving from "../views/gradedean/grade_problem_solving";
//试卷上传
import grade_paper_upload from "../views/gradedean/grade_paper_upload";
//差生池
import grade_pool from "../views/gradedean/grade_pool";
//各科数据
import grade_data_by_subject from "../views/gradedean/grade_data_by_subject";
//数据分析
import grade_data_analysis from "../views/gradedean/grade_data_analysis";
//学生账号管理
import grade_student_account_management_index from "../views/gradedean/grade_student_account_management/grade_student_account_management_index";
//学生转班消息
import grade_change_of_classmessage from "../views/gradedean/grade_student_account_management/grade_change_of_classmessage";
//学生账号添加
import grade_student_account_add from "../views/gradedean/grade_student_account_management/grade_student_account_add";
//教师带班数据
import teachers_performance from "../views/gradedean/teachers_performance";
//授课老师安排
import instructor_arrangement from "../views/gradedean/class_management/instructor_arrangement";
//班主任任命
import head_teacher_appointment from "../views/gradedean/class_management/head_teacher_appointment";
//班级信息
import class_info from "../views/gradedean/class_management/class_info";
//教师账号管理
import teacher_account_management from "../views/gradedean/teacher_account_management";
//各校数据对比
import school_gap from "../views/gradedean/school_gap";
//知识点文档上传
import knowledge_to_upload from "../views/gradedean/knowledge_to_upload";
//文章审核
import article_review from "../views/gradedean/article_review";
//指定分班时间
import divide_into_classes from "../views/gradedean/class_management/divide_into_classes";

/**
 * 校长
 */
//各年级数据
import grade_data from "../views/headmaster/grade_data";
//年级主任任命
import gradedean_appointment from "../views/headmaster/gradedean_appointment";
//本校薄弱点
import school_weaknesses from "../views/headmaster/school_weaknesses";
//升学数据
import entrance_data from "../views/headmaster/entrance_data";
//预计升学率
import expected_enrolment_rate from "../views/headmaster/expected_enrolment_rate";

/**
 * 教育局
 */
//学校账号管理
import school_account_management from "../views/educationbureau/school_account_management";
//校长账号管理
import headmaster_account_management from "../views/educationbureau/headmaster_account_management";
//数据统计
import edu_data_statistics from "../views/educationbureau/edu_data_statistics";
//试卷上传
import edu_paper_upload from "../views/educationbureau/edu_paper_upload";

Vue.use(Router);

//解决重新路由重复报错的
const VueRouterPush = Router.prototype.push;
Router.prototype.push = function push(to) {
  return VueRouterPush.call(this, to).catch(err => err);
};
export default new Router({
  routes: [
    {
      path: "/",
      name: "",
      component: login,
      hidden: true,
      meta: {
        requireAuth: true,
        roles: ["superadmin", "admin", "user"]
      }
    },
    {
      path: "/login",
      name: "登录",
      component: login,
      hidden: true,
      meta: {
        //requireAuth表示该路由需不需要检测,true表示需要,false表示不需要
        requireAuth: false
      }
    },
    {
      path: "/index",
      name: "主页",
      component: index,
      hidden: true,
      children: [
        {
          path: "/student/homework",
          name: "作业",
          component: homework,
          meta: { requireAuth: false }
        },
        {
          path: "/student/test",
          name: "考试",
          component: test,
          meta: { requireAuth: false }
        },
        {
          path: "/student/ask",
          name: "提问",
          component: ask,
          meta: { requireAuth: false }
        },
        {
          path: "/student/q_a_center",
          name: "问答中心",
          component: q_a_center,
          meta: { requireAuth: false }
        },
        {
          path: "/student/question_completed",
          name: "已做题库",
          component: question_completed,
          meta: { requireAuth: false }
        },
        {
          path: "/student/mistakes",
          name: "刷题",
          component: mistakes,
          meta: { requireAuth: false }
        },
        {
          path: "/student/stu_data_analysis",
          name: "数据分析",
          component: stu_data_analysis,
          meta: { requireAuth: false }
        },
        {
          path: "/student/article_search",
          name: "文章搜索",
          component: article_search,
          meta: { requireAuth: false }
        },
        {
          path: "/student/video_search",
          name: "视频搜索",
          component: video_search,
          meta: { requireAuth: false }
        },
        {
          path: "/student/choose_subject",
          name: "文理科选择",
          component: choose_subject,
          meta: { requireAuth: false }
        },
        {
          path: "/student/stu_personal/stu_data",
          name: "个人信息",
          component: stu_data,
          meta: { requireAuth: false }
        },
        {
          path: "/student/stu_personal/collection_title",
          name: "收藏的题目",
          component: collection_title,
          meta: { requireAuth: false }
        },
        {
          path: "/student/stu_personal/collection_article",
          name: "收藏的文章",
          component: collection_article,
          meta: { requireAuth: false }
        },
        {
          path: "/student/stu_personal/read_article",
          name: "阅读文章",
          component: read_article,
          meta: { requireAuth: false }
        },
        {
          path: "/student/job",
          name: "作业页面",
          component: job,
          meta: { requireAuth: false }
        },
        {
          path: "/student/exam",
          name: "考试页面",
          component: exam,
          meta: { requireAuth: false }
        },
        {
          path: "/teacher/assign_homework",
          name: "作业布置",
          component: assign_homework,
          meta: { requireAuth: false }
        },
        {
          path: "/teacher/paper_reviews/correcting_homework",
          name: "作业批改",
          component: correcting_homework,
          meta: { requireAuth: false }
        },
        {
          path: "/teacher/paper_reviews/correcting_paper",
          name: "试卷批改",
          component: correcting_paper,
          meta: { requireAuth: false }
        },
        {
          path: "/teacher/paper_reviews/correct",
          name: "开始批改作业",
          component: correct,
          meta: { requireAuth: false }
        },
        {
          path: "/teacher/paper_reviews/correctpaper",
          name: "开始批改试卷",
          component: correctpaper,
          meta: { requireAuth: false }
        },
        {
          path: "/teacher/tea_data_analysis/xxx",
          name: "班级学生数据",
          component: xxx,
          meta: { requireAuth: false }
        },
        {
          path: "/teacher/tea_data_analysis/class_data_comparison",
          name: "班级数据对比",
          component: class_data_comparison,
          meta: { requireAuth: false }
        },
        {
          path: "/teacher/tea_data_analysis/student_rank",
          name: "学生排名分布",
          component: student_rank,
          meta: { requireAuth: false }
        },
        {
          path: "/a",
          name: "数据对比",
          component: a,
          meta: {
            //requireAuth表示该路由需不需要检测,true表示需要,false表示不需要
            requireAuth: false
          }
        },
        {
          path: "/teacher/problem_solving",
          name: "问题解答",
          component: problem_solving,
          meta: { requireAuth: false }
        },
        {
          path: "/teacher/paper_upload",
          name: "试卷上传",
          component: paper_upload,
          meta: { requireAuth: false }
        },
        {
          path: "/teacher/upload_vedio",
          name: "视频上传",
          component: upload_vedio,
          meta: { requireAuth: false }
        },
        {
          path: "/teacher/pool",
          name: "差生池",
          component: pool,
          meta: { requireAuth: false }
        },

        {
          path: "/teacher/article_publishing",
          name: "文章发布",
          component: article_publishing,
          meta: { requireAuth: false }
        },
        {
          path: "/teacher/tea_personal",
          name: "个人中心",
          component: tea_personal,
          meta: { requireAuth: false }
        },
        {
          path: "/headteacher/headtea_assign_homework",
          name: "作业布置",
          component: headtea_assign_homework,
          meta: { requireAuth: false }
        },
        {
          path: "/headteacher/headtea_paper_reviews",
          name: "试卷批阅",
          component: headtea_paper_reviews,
          meta: { requireAuth: false }
        },
        {
          path: "/headteacher/headtea_problem_solving",
          name: "问题解答",
          component: headtea_problem_solving,
          meta: { requireAuth: false }
        },
        {
          path: "/headteacher/headtea_paper_upload",
          name: "试卷上传",
          component: headtea_paper_upload,
          meta: { requireAuth: false }
        },
        {
          path: "/headteacher/headtea_upload_vedio",
          name: "视频上传",
          component: headtea_upload_vedio,
          meta: { requireAuth: false }
        },
        {
          path: "/headteacher/headtea_pool",
          name: "差生池",
          component: headtea_pool,
          meta: { requireAuth: false }
        },
        {
          path: "/headteacher/data_by_subject",
          name: "各科数据",
          component: data_by_subject,
          meta: { requireAuth: false }
        },
        {
          path: "/headteacher/student_account_management/student_account_query",
          name: "本班学生账号",
          component: student_account_query,
          meta: { requireAuth: false }
        },
        {
          path: "/headteacher/student_account_management/student_account_add",
          name: "添加学生账号",
          component: student_account_add,
          meta: { requireAuth: false }
        },
        {
          path: "/headteacher/student_account_management/change_of_class",
          name: "转班处理",
          component: change_of_class,
          meta: { requireAuth: false }
        },
        {
          path:
            "/headteacher/student_account_management/change_of_classmessage",
          name: "转班消息及处理",
          component: change_of_classmessage,
          meta: { requireAuth: false }
        },
        {
          path: "/headteacher/college_entrance_examination_data_entry",
          name: "高考数据录入",
          component: college_entrance_examination_data_entry,
          meta: { requireAuth: false }
        },
        {
          path: "/headteacher/headtea_data_analysis",
          name: "数据分析",
          component: headtea_data_analysis,
          meta: { requireAuth: false }
        },
        {
          path: "/headteacher/headtea_personal",
          name: "个人中心",
          component: headtea_personal,
          meta: { requireAuth: false }
        },
        {
          path: "/gradedean/grade_assign_homework",
          name: "作业布置",
          component: grade_assign_homework,
          meta: { requireAuth: false }
        },
        {
          path: "/gradedean/grade_paper_reviews",
          name: "试卷批阅",
          component: grade_paper_reviews,
          meta: { requireAuth: false }
        },
        {
          path: "/gradedean/grade_problem_solving",
          name: "问题解答",
          component: grade_problem_solving,
          meta: { requireAuth: false }
        },
        {
          path: "/gradedean/grade_paper_upload",
          name: "试卷上传",
          component: grade_paper_upload,
          meta: { requireAuth: false }
        },
        {
          path: "/gradedean/grade_pool",
          name: "差生池",
          component: grade_pool,
          meta: { requireAuth: false }
        },
        {
          path: "/gradedean/grade_data_by_subject",
          name: "各科数据",
          component: grade_data_by_subject,
          meta: { requireAuth: false }
        },
        {
          path: "/gradedean/grade_data_analysis",
          name: "数据分析",
          component: grade_data_analysis,
          meta: { requireAuth: false }
        },
        {
          path:
            "/gradedean/grade_student_account_management/grade_student_account_management_index",
          name: "学生账号管理主页",
          component: grade_student_account_management_index,
          meta: { requireAuth: false }
        },
        {
          path:
            "/gradedean/grade_student_account_management/grade_change_of_classmessage",
          name: "年级主任学生转班消息",
          component: grade_change_of_classmessage,
          meta: { requireAuth: false }
        },
        {
          path:
            "/gradedean/grade_student_account_management/grade_student_account_add",
          name: "年级主任添加学生账号",
          component: grade_student_account_add,
          meta: { requireAuth: false }
        },
        {
          path: "/gradedean/teachers_performance",
          name: "教师带班数据",
          component: teachers_performance,
          meta: { requireAuth: false }
        },
        {
          path: "/gradedean/class_management/instructor_arrangement",
          name: "授课老师安排",
          component: instructor_arrangement,
          meta: { requireAuth: false }
        },
        {
          path: "/gradedean/class_management/head_teacher_appointment",
          name: "班主任任命",
          component: head_teacher_appointment,
          meta: { requireAuth: false }
        },
        {
          path: "/gradedean/class_management/class_info",
          name: "班级信息",
          component: class_info,
          meta: { requireAuth: false }
        },
        {
          path: "/gradedean/teacher_account_management",
          name: "教师账号管理",
          component: teacher_account_management,
          meta: { requireAuth: false }
        },
        {
          path: "/gradedean/school_gap",
          name: "各校数据对比",
          component: school_gap,
          meta: { requireAuth: false }
        },
        {
          path: "/gradedean/knowledge_to_upload",
          name: "知识点文档上传",
          component: knowledge_to_upload,
          meta: { requireAuth: false }
        },
        {
          path: "/gradedean/article_review",
          name: "文章审核",
          component: article_review,
          meta: { requireAuth: false }
        },
        {
          path: "/gradedean/class_management/divide_into_classes",
          name: "指定分班时间",
          component: divide_into_classes,
          meta: { requireAuth: false }
        },
        {
          path: "/headmaster/grade_data",
          name: "各年级数据",
          component: grade_data,
          meta: { requireAuth: false }
        },
        {
          path: "/headmaster/gradedean_appointment",
          name: "年级主任任命",
          component: gradedean_appointment,
          meta: { requireAuth: false }
        },
        {
          path: "/headmaster/school_weaknesses",
          name: "本校薄弱点",
          component: school_weaknesses,
          meta: { requireAuth: false }
        },
        {
          path: "/headmaster/entrance_data",
          name: "升学数据",
          component: entrance_data,
          meta: { requireAuth: false }
        },
        {
          path: "/headmaster/expected_enrolment_rate",
          name: "预计升学率",
          component: expected_enrolment_rate,
          meta: { requireAuth: false }
        },
        {
          path: "/educationbureau/school_account_management",
          name: "学校账号管理",
          component: school_account_management,
          meta: { requireAuth: false }
        },
        {
          path: "/educationbureau/headmaster_account_management",
          name: "校长账号管理",
          component: headmaster_account_management,
          meta: { requireAuth: false }
        },
        {
          path: "/educationbureau/edu_data_statistics",
          name: "数据统计",
          component: edu_data_statistics,
          meta: { requireAuth: false }
        },
        {
          path: "/educationbureau/edu_paper_upload",
          name: "试卷上传",
          component: edu_paper_upload,
          meta: { requireAuth: false }
        }
      ]
    }
  ]
  //   mode: "history"
});
